package com.xmut.mall.order.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmut.mall.order.entity.OrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmut.mall.order.searchparam.ManagerOrderSearchParam;
import com.xmut.mall.order.searchparam.OrderSearchParams;
import com.xmut.mall.order.searchparam.SellerOrderSearchParam;
import com.xmut.mall.order.vo.OrderSimpleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * 
 * 
 * @author 1912120131suntingxing
 * @email 1192081604@qq.com
 * @date 2023-02-05 04:48:13
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {

    /**
     * 获取用户中心中的订单分页数据
     * @param initPage
     * @param params
     * @return
     */
    IPage<OrderSimpleVO> getBuyerOrderByPage(Page<Object> initPage,@Param("params") OrderSearchParams params);

    /**
     * 获取卖家端的订单分页数据
     * @param initPage
     * @param param
     * @param date
     * @return
     */
    IPage<OrderEntity> getSellerOrderByPage(Page<Object> initPage,@Param("params") SellerOrderSearchParam param,@Param("now") Date date);

    /**
     * 获取商城官方平台的订单分页数据
     * @param initPage
     * @param param
     * @return
     */
    IPage<OrderEntity> getManagerOrderByPage(Page<Object> initPage,@Param("params") ManagerOrderSearchParam param);
}
